<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>领取会员卡</title>
<script type="text/javascript" src="//cdn.tryyun.net/js/jquery.min.js"></script>
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!--
<link rel="stylesheet" href="//res.wx.qq.com/open/libs/weui/2.3.0/weui.min.css">
<script type="text/javascript" src="//cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
<script>var vConsole = new VConsole();</script>
-->
<style>

</style>
</head>
<body>
<script type="text/javascript">
wx.config({
	debug: false,
	appId: "{$wx_config[appId]}",
	timestamp: "{$wx_config[timestamp]}",
	nonceStr: "{$wx_config[nonceStr]}",
	signature: "{$wx_config[signature]}",
	jsApiList: ['addCard', 'openCard', 'closeWindow']
});
wx.ready(function(){
	wx.addCard({
		cardList: [
			{ 
				cardId: "{$card_id}",
				cardExt: JSON.stringify({"code":"{$card_no}","openid":"{$openid}","timestamp":"{$timestamp}","nonce_str":"{$nonce_str}","signature":"{$signature}"}),
			}
		],
		success: function(res) {
			console.log(res);
			wx.closeWindow();
		},
		fail: function(res) {
			console.log(res);
			wx.closeWindow();
		},
		cancle: function(res) {
			console.log(res);
			wx.closeWindow();
		},
	});
});
wx.error(function(res){
	console.log(res);
});
</script>
</body>
</html>